package ads;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import android.util.Log;

/**
 * Parser xml do reklam.
 * @author Mateusz Kaflowski
 *
 */
public class ParserForDialog extends DefaultHandler {

	String text = null;
	String text2 = null;
	String title = null;
	String notification = null;
	String banner = null;
	String packagename = null;
	String dialog = null;
	String bicon = null;
	String shared = null;
	String link = null;

	public void startElement(String uri, String localName, String qName,
			Attributes attributes) throws SAXException {

		text = attributes.getValue("text");
		title = attributes.getValue("title");
		bicon = attributes.getValue("bicon");
		dialog = attributes.getValue("dialog");
		packagename = attributes.getValue("package");
		shared = attributes.getValue("sharedp");
		link = attributes.getValue("link");
		
	}

	public String getTitle() {
		return title;
	}
	
	public String getShared() {
		return shared;
	}
	
	public String getBIcon() {
		return bicon;
	}
	

	public String getText() {
		return text;
	}

	public String getPackagename() {
		return packagename;
	}
	
	public String getLink() {
		return link;
	}

	public boolean getDialog() {
		if (dialog.equals("true"))
			return true;
		else
			return false;
	}


}
